
// Form OF FLAT


// ...

let info = "hello  javascript ";
// info.forEach(element => {
//     console.log("element", element);
// });



let infoArray = Array.from(info)

console.log("infoArray", infoArray);
infoArray.forEach(item => {
    console.log("item", item);
})



//找到item 元素

let items = document.querySelectorAll(".item")
let itemArray = Array.from(items);
itemArray.forEach((item, index) => {
    item.innerHTML = "使用 array forEach创建的内容" + index
})




let ofArray1 = Array.of(1, 2, 3, 100, 200)
console.log("ofArray1", ofArray1);




//...  flat 扁平化

let aaa = [3, 4]
let arr1 = [1, 2,
    [
        3, 4,
        [5, 6,
            [7, 8, [9, 10]]]
    ]

];
console.log("arr1", arr1);
console.log("arr1.flat()", arr1.flat());
console.log("arr1.flat(1)", arr1.flat(1));
console.log("arr1.flat(2)", arr1.flat(2));
console.log("arr1.flat(Infinity)", arr1.flat(Infinity));





